<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Compose App</title>
    <link type="text/css" rel="stylesheet" href="styles.css">
    <script type="application/javascript" src="composeApp.js"></script>
    <script type="application/javascript">
        document.addEventListener("DOMContentLoaded", function() {
            var userAgent = navigator.userAgent;

            function getBrowserVersion(pattern) {
                var match = userAgent.match(pattern);
                return match ? parseInt(match[1], 10) : 0;
            }

            var chromeVersion = getBrowserVersion(/Chrome\/(\d+)/);
            var edgeVersion = getBrowserVersion(/Edge\/(\d+)/);
            var firefoxVersion = getBrowserVersion(/Firefox\/(\d+)/);
            var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent);
            var safariVersion = isSafari ? getBrowserVersion(/Version\/(\d+)/) : 0;

            function showBrowserSupportMessage(message) {
                var supportInfoElement = document.getElementById('browserSupportInfo');
                supportInfoElement.innerHTML = message;
                supportInfoElement.style.display = "block";
            }

            if (chromeVersion > 0) {
                if (chromeVersion < 119) {
                    showBrowserSupportMessage("您的浏览器版本过低，请升级至Chrome 119以上版本。当前版本：" + chromeVersion);
                }
            } else if (edgeVersion > 0) {
                if (edgeVersion < 119) {
                    showBrowserSupportMessage("您的浏览器版本过低，请升级至Edge 119以上版本。当前版本：" + edgeVersion);
                }
            } else if (firefoxVersion > 0) {
                if (firefoxVersion < 120) {
                    showBrowserSupportMessage("您的浏览器版本过低，请升级至Firefox 120以上版本。当前版本：" + firefoxVersion);
                }
            } else if (safariVersion > 0) {
                if (safariVersion < 18) {
                    showBrowserSupportMessage("您的浏览器版本过低，请升级至Safari 18以上版本。当前版本：" + safariVersion);
                }
            } else {
                showBrowserSupportMessage("网页暂不支持该浏览器，请使用最新版的Chrome、Edge、Safari或Firefox。");
            }
        });
    </script>
</head>
<body>
<div id="browserSupportInfo" style="display:none;"></div>
</body>
</html>